package net.sxnic.ugr.dept.action;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import net.sxnic.comm.basecode.BaseCodeManager;
import net.sxnic.ugr.role.Role;
import net.sxnic.ugr.dept.Dept;
/**
 * 
 * Comments: 添加部门action
 * <p>
 *  @author 系统国业 create date : 2013-4-12
 * <p>
 * 
 * 
 */
@SuppressWarnings("serial")
public class PreCreate extends DeptAction {
	
	@Autowired
	private BaseCodeManager baseCodeManager;

	public String execute() throws Exception {

		try {
			checkRoles(Role.SYSTEM_ADMIN);

			if (StringUtils.isNotBlank(root)) {
				parent = deptManager.get(root);
			}

			dept = new Dept();

		} catch (Exception e) {
			e.printStackTrace();
		}

		return SUCCESS;
	}

}
